package com.per.yyyFrame.common;

import com.per.yyyFrame.enums.RespCode;
import org.apache.poi.ss.formula.functions.T;

import java.io.Serializable;

/**
 * Created with IntelliJ IDEA.
 *
 * @author: yyy
 * Date: 2022/2/7
 * Time: 15:36
 * Description:响应封装
 */
public class ServerResponse implements Serializable {
  private int status;
  private String msg;
  private Object data;

  public ServerResponse(){
    this.status= RespCode.SUCCESS.getCode();
    this.msg=null;
    this.data=null;
  }

  public ServerResponse(String msg){
    this.status= RespCode.SUCCESS.getCode();
    this.msg=msg;
    this.data=null;
  }


  //自定义
  public ServerResponse(int status,String msg,T data){
    this.status= status;
    this.msg=msg;
    this.data=data;
  }

  //正确状态，正确信息
  public ServerResponse(int status,Object data){
    this.status= status;
    this.msg=null;
    this.data=data;
  }

  public int getStatus() {
    return status;
  }

  public String getMsg() {
    return msg;
  }

  public Object getData() {
    return data;
  }

  public void setStatus(int status) {
    this.status = status;
  }

  public void setMsg(String msg) {
    this.msg = msg;
  }

  public void setData(T data) {
    this.data = data;
  }
}
